import React from 'react';
import { default as SheetComponent, Props as SheetProp, AlertAction } from './Sheet';
import Modal, { Props as ModalProps } from './Modal';

type SheetType = {
    type?: 'default';
} & SheetProp;

type ModalType = {
    type: 'modal';
} & ModalProps


const Sheet: React.FC<SheetType | ModalType> = ({ type, ...other }) => {
    return <>
        {type === 'modal' ? <Modal {...(other as ModalProps)} /> : <SheetComponent {...(other as SheetProp)} />}
    </>
}

export default Sheet

export type {
    AlertAction
}